<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="org.saiht.guestbook.*" %>

<html>
  <head>
    <style>
	  .main { margin: 0px 25px 25px 25px; width:600px; }
	  .headerMenu { text-align: right; width: 100% }
	  .entryList, .entry { border: 2px coral solid; padding: 5px; margin-bottom: 20px; }
	  .entry { height: 7em; }
	  .signin { text-align: center; }
	  .postedby { margin-left: 15px; margin-bottom: 10px; }
	  h2 { margin: 0px; }
	  h3 { margin: 0px 0px 10px 0px; font-size: 1em; } 
	</style>
  </head>
  <body>
    <div class="main">
	  <div class="header">
	    <h1>
		  Gästebuch
		</h1>
	  </div>
	  
	  <h2>
	    Neuer Eintrag
	  </h2>
	  <div class="entry">
	    <form action="/guestbook" method="post">
		  <table>
		    <tr>
			  <td>Eintrag: </td>
			  <td>
			    <textarea name="content" rows="3" cols="60"></textarea>
			  </td>
			</tr>
			<tr>
			  <td>Dein Name: </td>
			  <td>
			    <input name="poster" type="text" value=""/>
			  </td>
			</tr>
		  </table>
		  
		  <div>
		    <input type="submit" value="Erstellen" />
		  </div>
		  
		</form>
	  </div>
	  
	  <h2>
	    Einträge
	  </h2>
	  <div class="entrylist">
	  
	    <%
		List<GuestBookEntry> entries = new ArrayList();
		
		//Retrieve list of entries from datastore
		
		%>
		<%
		if (entries.isEmpty()) {
		  %>
		  <div class="noEntries">
		    Keine Einträge
		  </div>
		  <%
		} else {
		  %>
		  <table>
		    <%
			for (GuestBookEntry e : entries) {
			  %>
			  <tr>
			    <td>

				   <div> leeer </div>
				</td>
			  </tr>
			<%
			}
			%>
		  </table>
		<%
		}
		%>
	  </div>
	</div>
  </body>
</html>

